package RW;

public class Vehicle {
	private int speed;//速度
	private int size;//体积
	
public Vehicle(int speed, int size) {
		super();
		this.speed = speed;
		this.size = size;
	}
public double getSpeed() {
	return speed;
}
public void setSpeed(int speed) {
	this.speed = speed;
}
public int getSize() {
	return size;
}
public void setSize(int size) {
	this.size = size;
}
public void move() {
	if (speed>0) {
		System.out.println("开始移动");
	}else {
		System.out.println("不能移动");
	}
	
}
public void speedUp()//加速
{
	if (speed<240) {
		speed+=10;
	}else {
		System.out.println("速度达到最高了");
	}
}

public void speedDown()//减速
{
	if (speed>=0) {
		speed-=10;
	}else {
		System.out.println("速度达到最低了");
	}
}
@Override
public String toString() {
	return "speed=" + speed + ", size=" + size + ", getSpeed()=" + getSpeed() + ", getSize()=" + getSize();
}

}
